unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics, cxControls, cxLookAndFeels,
  cxLookAndFeelPainters, dxSpreadSheetCore, dxSpreadSheetFormulas,
  dxSpreadSheetFunctions, dxSpreadSheetGraphics, dxSpreadSheetClasses,
  dxSpreadSheetTypes, dxSpreadSheet, Vcl.StdCtrls, Vcl.Buttons, Vcl.ToolWin,
  Vcl.ComCtrls, dxSkinsCore, dxCore, dxCoreClasses, dxHashUtils,
  dxSpreadSheetPrinting;

type
  TForm1 = class(TForm)
    dxSpreadSheet1: TdxSpreadSheet;
    Tool_1: TToolBar;
    btn1: TBitBtn;
    btn2: TBitBtn;
    btn3: TBitBtn;
    btn4: TBitBtn;
    procedure btn4Click(Sender: TObject);
    procedure btn3Click(Sender: TObject);
  private
  public
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.btn3Click(Sender: TObject);
var
  CellA:TdxSpreadSheetCell;
begin
  if dxSpreadSheet1.ActiveSheetAsTable.Cells[1,5]=nil then
  begin
    dxSpreadSheet1.ActiveSheetAsTable.CreateCell(1,5);
  end;
  CellA:=dxSpreadSheet1.ActiveSheetAsTable.Cells[1,5];
  if CellA<>nil then
  begin
    CellA.SetText('TRUE');
  end;
end;

procedure TForm1.btn4Click(Sender: TObject);
var
  OD:TOpenDialog;
begin
  OD:=TOpenDialog.Create(nil);
  try
    if  OD.Execute(Self.Handle) then
    begin
      Self.dxSpreadSheet1.LoadFromFile(OD.FileName);
    end;
  finally
    FreeAndNil(OD);
  end;
end;

end.
